<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->

<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
        <meta name="description" content="" />
        <meta name="author" content="" />
        <style>
            body {
                font-family: 'Sans', sans-serif;
                line-height: 30px;
                background:url('assets/img/background15.jpg')no-repeat;
                background-size:cover;
            }
            table{
                text-align: center;
            }


            .parent {
                filter:alpha(Opacity=90);
                -moz-opacity:0.8;
                opacity: 0.8;
                background-color: #000;
                color:#fff;
                position:relative;
                width:1300px;
                left:50%;
                margin-left:-650px;
                border:1px solid #fff;
                text-align: center;

            }
            .score-view{
                filter:alpha(Opacity=90);
                -moz-opacity:0.8;
                opacity: 0.8;
                background-color: #000;
                color:#fff;
                position:relative;
                width:1800px;
                left:50%;
                margin-left:-900px;
                border:1px solid #fff;
                text-align: center;
                padding-top: 20px;
                padding-bottom: 20px;
            }
            .admin{
                position:relative;
                left:50%;
                width:760px;
                margin-left:-380px;

            }
            .judge{
                position:relative;
                left:50%;
                width:900px;
                margin-left:-450px;

            }
            .score{
                position:relative;
                left:50%;
                width:634px;
                margin-left:-317px;

            }
            .question{
                position:relative;
                left:50%;
                width:863px;
                margin-left:-431px;
                height: 500px;
            }
            .btn {
                width: 200px;
                height: 60px;
                font-size: 20px;
            }
            button:hover{
                color: #2945a5;
            }
            .form-text-center{
                text-align: center;
                font-size: 20px;
            }
            .top{
                filter:alpha(Opacity=80);
                -moz-opacity:0.5;
                opacity: 0.8;
                /* 设置宽度高度背景颜色 */
                height: 40px; /*高度改为自动高度*/
                width:100%;
                margin-left: 0;
                background:#666;
                position: display; /*固定在顶部*/
                top: 0;/*离顶部的距离为0*/
                margin-bottom: 5px;
                margin-top: -16px;
            }
            .top ul{
                /* 清除ul标签的默认样式 */
                width: auto;/*宽度也改为自动*/
                list-style-type: none;
                white-space:nowrap;
                overflow: hidden;
                margin-left: 5%;
                /* margin-top: 0;          */
                padding: 0;

            }
            .top li {
                float:left; /* 使li内容横向浮动，即横向排列  */
                margin-right:2%;  /* 两个li之间的距离*/
                position: relative;
                overflow: hidden;
            }

            .top li a{
                /* 设置链接内容显示的格式*/
                display: block; /* 把链接显示为块元素可使整个链接区域可点击 */
                color:white;
                text-align: center;
                padding: 3px;
                overflow: hidden;
                text-decoration: none; /* 去除下划线 */

            }
            .top li a:hover{
                /* 鼠标选中时背景变为黑色 */
                background-color: #000;
            }
            .top ul li ul{
                /* 设置二级菜单 */
                margin-left: -0.2px;
                background:#666;
                position: relative;
                display: none; /* 默认隐藏二级菜单的内容 */

            }
            .top ul li ul li{
                /* 二级菜单li内容的显示 */

                float:none;
                text-align: center;
            }
            .top ul li:hover ul{
                /* 鼠标选中二级菜单内容时 */
                display: block;
            }
        </style>
        <!--[if IE]>
            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
            <![endif]-->
        <title>比赛信息总览</title>

    </head>
    <body>

        <div class="top" onmouseenter="div_box_margin_active()" onmouseleave="div_box_margin_deactive()">
            <center> 
                <ul>
                    <li>
                        <a href="#">评委信息查看</a>
                        <ul>
                            <li><a href="#" onclick="window_leader(0)">评委场地安排</a></li>
                            <li><a href="#" onclick="window_leader(1)">评委打分信息</a></li>
                            <li><a href="#" onclick="window_leader(2)">评委注册信息</a></li>
                        </ul>
                    </li>
                    <li>
                        <a href="#">比赛成绩查看</a>
                        <ul>
                            <li><a href="#" onclick="window_leader(3)">队伍成绩查看</a></li>
                            <li><a href="#" onclick="window_leader(4)">个人成绩查看</a></li>
                            <li><a href="#" onclick="window_leader(5)">选题情况查看</a></li>
                        </ul>
                    </li>
                    <li>
                        <a href="#">注册信息查看</a>
                        <ul>
                            <li><a href="#" onclick="window_leader(6)">参赛师生注册信息</a></li>
                            <li><a href="#" onclick="window_leader(7)">学校注册信息</a></li>
                            <li><a href="#" onclick="window_leader(8)">志愿者注册信息</a></li>
                        </ul>
                    </li> 
                </ul>
            </center>      
        </div>




        <?PHP
        if (!empty($_GET['email'])) {$email = $_GET['email'];} else {$email = '';}
        $mysqli = mysqli_init();
        $mysqli->options(MYSQLI_OPT_CONNECT_TIMEOUT, 2); //设置超时时间
        $mysqli->real_connect('127.0.0.1', 'root', 'mysql');
        $sql = "CREATE DATABASE IF NOT EXISTS CUPT DEFAULT CHARSET utf8 COLLATE utf8_general_ci;";
        if ($mysqli->query($sql) == TRUE) {
        //printf("Table CUPT successfully created.\n");
        }
        mysqli_select_db($mysqli, "CUPT");
        $sql="select rounds_match_list.site,rounds_match_list.round,rounds_match_list.session,sl_1.school as school_1,sl_2.school as school_2,sl_3.school as school_3 ,j_c.name as chairman ,j_1.name as judge_1 ,j_2.name as judge_2 ,j_3.name as judge_3 ,j_4.name as judge_4 ,j_5.name as judge_5
        from rounds_match_list 
        inner join school_information_list as sl_1 on (rounds_match_list.school_1_number=sl_1.school_number)
        inner join school_information_list as sl_2 on(rounds_match_list.school_2_number=sl_2.school_number)
        inner join school_information_list as sl_3 on(rounds_match_list.school_3_number=sl_3.school_number)
        left join (select judge.name,judge.chairman_qualifications,sl.school_number from judge inner join school_information_list as sl on (sl.school=judge.school)) as j_c on (j_c.school_number=left(rounds_match_list.chairman_number,1) and j_c.chairman_qualifications=right(rounds_match_list.chairman_number,1))
        left join (select judge.name,judge.chairman_qualifications,sl.school_number from judge inner join school_information_list as sl on (sl.school=judge.school)) as j_1 on (j_1.school_number=left(rounds_match_list.judge_1_number,1) and j_1.chairman_qualifications=right(rounds_match_list.judge_1_number,1))
        left join (select judge.name,judge.chairman_qualifications,sl.school_number from judge inner join school_information_list as sl on (sl.school=judge.school)) as j_2 on (j_2.school_number=left(rounds_match_list.judge_2_number,1) and j_2.chairman_qualifications=right(rounds_match_list.judge_2_number,1))
        left join (select judge.name,judge.chairman_qualifications,sl.school_number from judge inner join school_information_list as sl on (sl.school=judge.school)) as j_3 on (j_3.school_number=left(rounds_match_list.judge_3_number,1) and j_3.chairman_qualifications=right(rounds_match_list.judge_3_number,1))
        left join (select judge.name,judge.chairman_qualifications,sl.school_number from judge inner join school_information_list as sl on (sl.school=judge.school)) as j_4 on (j_4.school_number=left(rounds_match_list.judge_4_number,1) and j_4.chairman_qualifications=right(rounds_match_list.judge_4_number,1))
        left join (select judge.name,judge.chairman_qualifications,sl.school_number from judge inner join school_information_list as sl on (sl.school=judge.school)) as j_5 on (j_5.school_number=left(rounds_match_list.judge_5_number,1) and j_5.chairman_qualifications=right(rounds_match_list.judge_5_number,1))
        order by site asc, session+0 asc; ";

        $rst = $mysqli->query($sql);
        $string2_1='';
        while ($row = mysqli_fetch_assoc($rst)) {

        $site = $row['site'];
        $string2_1=$string2_1."<td>$site</td>";
        $round = $row['round'];
        $string2_1=$string2_1."<td>$round</td>";
        $session = $row['session'];
        $string2_1=$string2_1."<td>$session</td>";
        $school_1 = $row['school_1'];
        $string2_1=$string2_1."<td>$school_1</td>";
        $school_2 = $row['school_2'];
        $string2_1=$string2_1."<td>$school_2</td>";
        $school_3 = $row['school_3'];
        $string2_1=$string2_1."<td>$school_3</td>";

        $chairman = $row['chairman'];
        $string2_1=$string2_1."<td>$chairman</td>";
        $judge_1 = $row['judge_1'];
        $string2_1=$string2_1."<td>$judge_1</td>";
        $judge_2 = $row['judge_2'];
        $string2_1=$string2_1."<td>$judge_2</td>";
        $judge_3 = $row['judge_3'];
        $string2_1=$string2_1."<td>$judge_3</td>";
        $judge_4 = $row['judge_4'];
        $string2_1=$string2_1."<td>$judge_4</td>";
        $judge_5 = $row['judge_5'];
        $string2_1=$string2_1."<td>$judge_5</td>";
        $string2_1="<tr>".$string2_1."</tr>";
        }




        $sql="select *,sl_1.school as school_1 ,sl_2.school as school_2 ,sl_3.school as school_3 ,j_c.name as chairman,j_1.name as judge_1,j_2.name as judge_2,j_3.name as judge_3,j_4.name as judge_4,j_5.name as judge_5
        from session_match_list 
        inner join rounds_match_list 
        on (session_match_list.site=rounds_match_list.site and session_match_list.round=rounds_match_list.round and session_match_list.session=rounds_match_list.session) 
        inner join school_information_list as sl_1 on (rounds_match_list.school_1_number=sl_1.school_number) 
        inner join school_information_list as sl_2 on (rounds_match_list.school_2_number=sl_2.school_number) 
        inner join school_information_list as sl_3 on (rounds_match_list.school_3_number=sl_3.school_number)
        left join judge as j_c on (left(rounds_match_list.chairman_number,1)=j_c.school_number and right(rounds_match_list.chairman_number,1)=j_c.chairman_qualifications) 
        left join judge as j_1 on (left(rounds_match_list.judge_1_number,1)=j_1.school_number and right(rounds_match_list.judge_1_number,1)=j_1.chairman_qualifications) 
        left join judge as j_2 on (left(rounds_match_list.judge_2_number,1)=j_2.school_number and right(rounds_match_list.judge_2_number,1)=j_2.chairman_qualifications) 
        left join judge as j_3 on (left(rounds_match_list.judge_3_number,1)=j_3.school_number and right(rounds_match_list.judge_3_number,1)=j_3.chairman_qualifications) 
        left join judge as j_4 on (left(rounds_match_list.judge_4_number,1)=j_4.school_number and right(rounds_match_list.judge_4_number,1)=j_4.chairman_qualifications) 
        left join judge as j_5 on (left(rounds_match_list.judge_5_number,1)=j_5.school_number and right(rounds_match_list.judge_5_number,1)=j_5.chairman_qualifications) 
        ;";
        $rst = $mysqli->query($sql);
        $string2_2='';
        $identify_list=array('','正方','反方','评论方');
        while ($row = mysqli_fetch_assoc($rst)) {
        $string2_2_1='';
        $string2_2_2='';


        $school_[1] = $row['school_1'];
        $school_[2] = $row['school_2'];
        $school_[3] = $row['school_3'];

        $judge_number=array('','','','','','');
        $judge_=array('','','','','','');
        $judge_score=array(
        array('','','','','',''),
        array('','','','','',''),
        array('','','','','',''),
        array('','','','','','')
        );

        $string2_2_1=$string2_2_1."<tr><th colspan='7' >赛场信息</th><th colspan='5'>评委打分</th></tr>";
        $string2_2_1=$string2_2_1."<th>场地号</th><th>轮次</th><th>场次</th><th>本场题目</th><th>主席</th><th>学校</th><th>队伍身份</th>";
        for($judge_index=1;$judge_index<=5;$judge_index++){
        $judge_number[$judge_index]=$row["judge_"."$judge_index"."_number"];
        $judge_[$judge_index]=$row["judge_"."$judge_index"];
        $string2_2_1=$string2_2_1."<td>".$judge_[$judge_index]."</td>";

        for($school_index=1;$school_index<=3;$school_index++){
        $judge_score[$judge_index][$school_index] = $row["judge_"."$judge_index"."_score_"."$school_index"];

        //$string2_2_2=$string2_2_2."<td>".$judge_score[$judge_index][$school_index]."</td>";
        }
        }
        $string2_2_1="<tr>".$string2_2_1."</tr>";

        $site = $row['site'];
        $string2_2_2=$string2_2_2."<td rowspan='3'>$site</td>";
        $round = $row['round'];
        $string2_2_2=$string2_2_2."<td rowspan='3'>$round</td>";
        $session = $row['session'];
        $string2_2_2=$string2_2_2."<td rowspan='3'>$session</td>";
        $accept_question = $row['accept_question'];
        $string2_2_2=$string2_2_2."<td rowspan='3'>$accept_question</td>";
        $chairman = $row['chairman'];
        $string2_2_2=$string2_2_2."<td rowspan='3'>$chairman</td>";

        for($identify=1;$identify<=3;$identify++){
        $sub_string2_2_2='';
        $sub_string2_2_2=$sub_string2_2_2."<td>$school_[$identify]</td>";
        $sub_string2_2_2=$sub_string2_2_2."<td>$identify_list[$identify]</td>";

        for($judge_index=1;$judge_index<=5;$judge_index++){
        $sub_string2_2_2=$sub_string2_2_2."<td>".$judge_score[$judge_index][$identify]."</td>";
        }
        if($identify==1){
        $string2_2_2="<tr>".$string2_2_2.$sub_string2_2_2."</tr>";
        }else{
        $string2_2_2=$string2_2_2."<tr>".$sub_string2_2_2."</tr>";
        }
        }
        $string2_2_2="<tr>".$string2_2_2."</tr>";
        $string2_2=$string2_2.$string2_2_1.$string2_2_2;
        }

        $sql="select * from judge;";
        $rst = $mysqli->query($sql);
        $string2_3='';
        while ($row = mysqli_fetch_assoc($rst)) {
        $email = $row['email'];
        $string2_3=$string2_3."<td>$email</td>";
        $name = $row['name'];
        $string2_3=$string2_3."<td>$name</td>";
        $sex = $row['sex'];
        $string2_3=$string2_3."<td>$sex</td>";
        $school = $row['school'];
        $string2_3=$string2_3."<td>$school</td>";
        $phone_number = $row['phone_number'];
        $string2_3=$string2_3."<td>$phone_number</td>";
        if($row['chairman_qualifications']=='b'){$chairman_qualifications ='否';}
        elseif($row['chairman_qualifications']=='a'){$chairman_qualifications ='是';}
        $string2_3=$string2_3."<td>$chairman_qualifications</td>";    
        $clothing_model = $row['clothing_model'];
        $string2_3=$string2_3."<td>$clothing_model</td>";
        $bank_account=$row['bank_account'];
        $string2_3=$string2_3."<td>$bank_account</td>";
        $bank=$row['bank'];
        $string2_3=$string2_3."<td>$bank</td>";

        $string2_3="<tr>".$string2_3."</tr>";
        }


        ?>      
        <div id="grand" style="margin-top:0px">
            <div id="score_view_div" class="score-view">
                <div class='judge-div' id='judge_site'>
                    <center>
                        <table id="table_0" border="1"  cellspacing="0" style='width: 1600px;'>
                            <tr>
                                <th colspan="12">评委场地安排</th>
                            </tr>
                            <tr>
                                <th>场地号</th><th>轮次</th><th>场次</th><th>正方学校</th><th>反方学校</th><th>评论方学校</th><th>主席</th><th>评委1</th><th>评委2</th><th>评委3</th><th>评委4</th><th>评委5</th>
                            </tr>
                            <?PHP echo $string2_1;?>
                        </table>
                    </center>
                </div>

                <div  class='judge-div' id='judge_score'>
                    <center>
                        <table id="table_1" border="1"  cellspacing="0" style='width: 1600px;'>
                            <tr>
                                <th colspan="12">评委打分信息</th>
                            </tr>
                            <?PHP echo $string2_2;?>
                        </table>
                    </center>
                </div>
                <div  class='judge-div' id='judge_signup'>
                    <center>
                        <table id="table_2" border="1"  cellspacing="0" style='width: 1600px;'>
                            <tr>
                                <th colspan="9">评委注册信息</th>
                            </tr>
                            <tr>
                                <th>Email</th><th>姓名</th><th>性别</th><th>学校</th><th>手机号码</th><th>是否做主席</th><th>衣服尺码</th><th>银行卡号</th><th>开户银行</th>
                            </tr>
                            <?PHP echo $string2_3;?>
                        </table>
                    </center>
                </div>



            <?PHP

            $sql="select school,sum(participant_score)  as school_score from participant_score_list group by school order by school_score desc;";
            $rst = $mysqli->query($sql);
            $string3_1='';
            while ($row = mysqli_fetch_assoc($rst)) {
            $school = $row['school'];
            $string3_1=$string3_1."<td>$school</td>";
            $school_score = $row['school_score'];
            $string3_1=$string3_1."<td>$school_score</td>";
            $string3_1="<tr>".$string3_1."</tr>";
            }


            $sql="select *,volunteer.name as admin_name from participant_score_list inner join volunteer on (participant_score_list.admin_email=volunteer.email) order by identity asc,participant_score desc;";
            $rst = $mysqli->query($sql);
            $string3_2='';
            while ($row = mysqli_fetch_assoc($rst)) {
            $rounds = $row['rounds'];
            $string3_2=$string3_2."<td>$rounds</td>";
            $session = $row['session'];
            $string3_2=$string3_2."<td>$session</td>";
            $school = $row['school'];
            $string3_2=$string3_2."<td>$school</td>";
            $name = $row['name'];
            $string3_2=$string3_2."<td>$name</td>";
            $question = $row['question'];
            $string3_2=$string3_2."<td>$question</td>";
            $identity = $row['identity'];
            switch ($identity){
            case 1:$identity_='正方';break;
            case 2:$identity_='反方';break;
            case 3:$identity_='评论方';break;
            }
            $string3_2=$string3_2."<td>$identity_</td>";
            $participant_score = $row['participant_score'];
            $string3_2=$string3_2."<td>$participant_score</td>";
            $admin_name = $row['admin_name'];
            $string3_2=$string3_2."<td>$admin_name</td>";
            $string3_2="<tr>".$string3_2."</tr>";
            }



            $sql="select * from school_question_list;";
            $rst = $mysqli->query($sql);
            $string3_3='';
            while ($row = mysqli_fetch_assoc($rst)) {

            $school_participant= $row['school'];
            $string3_3=$string3_3."<td>$school_participant</td>";
            $question=array('','','','','','','','','','','','','','','','','','');
            $question_state_word=array('','','','','','','','','','','','','','','','','','');
            for($i=1;$i<=17;$i++){
            $question[$i]= $row["question_$i"];


            if(strstr($question[$i],'3')){$question_state_word[$i]=$question_state_word[$i].'作为正方拒绝过<br/>';}
            if(strstr($question[$i],'4')){$question_state_word[$i]=$question_state_word[$i].'作为正方比赛过<br/>';}
            if(strstr($question[$i],'5')){$question_state_word[$i]=$question_state_word[$i].'作为反方比赛过<br/>';}
            $question_state_word[$i]=rtrim($question_state_word[$i], "<br/>");
            $string3_3=$string3_3."<td>$question_state_word[$i]</td>";
            }
            $string3_3="<tr>".$string3_3."</tr>";
            }
            ?>

                <div id="school_score" class="judge-div">
                    <center>
                        <table id="table_3" border="1"  cellspacing="0" style='width: 1000px;'>
                            <tr>
                                <th colspan="2">队伍比赛成绩</th>
                            </tr>
                            <tr>
                                <th>学校</th><th>总分数</th>
                            </tr>
                            <?PHP echo $string3_1;?>
                        </table>
                    </center>
                </div>
                <div id="participant_score" class="judge-div">
                    <center>
                        <table id="table_4" border="1"  cellspacing="0" style='width: 1600px;'>
                            <tr>
                                <th colspan="8">个人比赛成绩</th>
                            </tr>
                            <tr>
                                <th>轮次</th><th>场次</th><th>学校</th><th>参赛者姓名</th><th>题目</th><th>场上身份</th><th>分数</th><th>成绩录入者姓名</th>
                            </tr>
                            <?PHP echo $string3_2;?>
                        </table>
                    </center>
                </div>
                <div id="question_select" class="judge-div">
                    <center>
                        <table id="table_5" border="1"  cellspacing="0" style='width: 1600px;'>
                            <tr>
                                <th colspan="18">学校选题情况</th>
                            </tr>
                            <tr>
                                <th>学校</th><th>题目1</th><th>题目2</th><th>题目3</th><th>题目4</th><th>题目5</th><th>题目6</th><th>题目7</th><th>题目8</th><th>题目9</th><th>题目10</th><th>题目11</th><th>题目12</th><th>题目13</th><th>题目14</th><th>题目15</th><th>题目16</th><th>题目17</th>
                            </tr> 
                            <?PHP echo $string3_3;?>
                        </table>
                    </center>
                </div>


            <?PHP

            $sql="select * from participant order by school;";
            $rst = $mysqli->query($sql);
            $string4_1='';
            while ($row = mysqli_fetch_assoc($rst)) {
            $email = $row['email'];
            $string4_1=$string4_1."<td>$email</td>";
            $name = $row['name'];
            $string4_1=$string4_1."<td>$name</td>";
            $sex = $row['sex'];
            $string4_1=$string4_1."<td>$sex</td>";
            $school = $row['school'];
            $string4_1=$string4_1."<td>$school</td>";
            $job_title = $row['job_title'];
            $string4_1=$string4_1."<td>$job_title</td>";
            $team_position = $row['team_position'];
            $string4_1=$string4_1."<td>$team_position</td>";
            $school_position = $row['school_position'];
            $string4_1=$string4_1."<td>$school_position</td>";
            $phone_number = $row['phone_number'];
            $string4_1=$string4_1."<td>$phone_number</td>";
            $clothing_model = $row['clothing_model'];
            $string4_1=$string4_1."<td>$clothing_model</td>";
            $bank_account=$row['bank_account'];
            $string4_1=$string4_1."<td>$bank_account</td>";
            $bank=$row['bank'];
            $string4_1=$string4_1."<td>$bank</td>";
            $committee=$row['committee'];
            $string4_1=$string4_1."<td>$committee</td>";
            $string4_1="<tr>".$string4_1."</tr>";
            }


            $sql="select * from school_information_list order by school;";
            $rst = $mysqli->query($sql);
            $string4_2='';
            while ($row = mysqli_fetch_assoc($rst)) {
            $email_ = $row['email'];
            $string4_2=$string4_2."<td>$email_</td>";
            $name = $row['name'];
            $string4_2=$string4_2."<td>$name</td>";
            $school = $row['school'];
            $string4_2=$string4_2."<td>$school</td>";
            $taxpayer_identification_number = $row['taxpayer_identification_number'];
            $string4_2=$string4_2."<td>$taxpayer_identification_number</td>";
            $invoice_title = $row['invoice_title'];
            $string4_2=$string4_2."<td>$invoice_title</td>";
            $single_rooms = $row['single_rooms'];
            $string4_2=$string4_2."<td>$single_rooms</td>";
            $standard_rooms = $row['standard_rooms'];
            $string4_2=$string4_2."<td>$standard_rooms</td>";
            $meeting_datetime = $row['meeting_datetime'] ;
            $string4_2=$string4_2."<td>$meeting_datetime</td>";
            $leave_datetime = $row['leave_datetime'] ;
            $string4_2=$string4_2."<td>$leave_datetime</td>";
            $halal_foods = $row['halal_foods'];
            $string4_2=$string4_2."<td>$halal_foods</td>";
            $school_number = $row['school_number'];
            $string4_2=$string4_2."<td>$school_number</td>";
            $string4_2="<tr>".$string4_2."</tr>";
            }


            $sql="select * from volunteer";
            $rst = $mysqli->query($sql);
            $string4_3='';
            while ($row = mysqli_fetch_assoc($rst)) {
            $email=$row['email'];
            if($email!='')
            {
            $string4_3=$string4_3."<td>$email</td>";
            $name = $row['name'];
            $string4_3=$string4_3."<td>$name</td>";
            $sex = $row['sex'];
            $string4_3=$string4_3."<td>$sex</td>";
            $volunteer_position = $row['volunteer_position'];
            $string4_3=$string4_3."<td>$volunteer_position</td>";
            $work_days = $row['work_days'];
            $string4_3=$string4_3."<td>$work_days</td>";
            $phone_number = $row['phone_number'];
            $string4_3=$string4_3."<td>$phone_number</td>";
            $clothing_model = $row['clothing_model'];
            $string4_3=$string4_3."<td>$clothing_model</td>";
            $bank_account=$row['bank_account'];
            $string4_3=$string4_3."<td>$bank_account</td>";
            $secret_key=$row['secret_key'];
            if($secret_key!=''){
            $string4_3=$string4_3."<td>管理员</td>";
            }else{
            $string4_3=$string4_3."<td>普通志愿者</td>";
            }
            $string4_3="<tr>".$string4_3."</tr>";
            }
            }
            ?>

                <div id="participant_signup" class="judge-div">
                    <center>
                        <table id="table_6" border="1"  cellspacing="0" style='width: 1000px;'>
                            <tr>
                                <th colspan="12">参赛者注册信息</th>
                            </tr>
                            <tr>
                                <th>Email</th><th>姓名</th><th>性别</th><th>学校</th><th>职称或年级专业</th><th>队内职务</th><th>校内职务</th><th>手机号码</th><th>衣服尺码</th><th>银行卡号</th><th>开户银行</th><th>是否为竞赛委员会成员</th>
                            </tr>
                            <?PHP echo $string4_1;?>
                        </table>
                    </center>
                </div>
                <div id="school_signup" class="judge-div">
                    <center>
                        <table id="table_7" border="1"  cellspacing="0" style='width: 1600px;'>
                            <tr>
                                <th colspan="11">学校注册信息</th>
                            </tr>
                            <tr>
                                <th>注册人Email</th><th>注册人姓名</th><th>学校</th><th>纳税人税号</th><th>发票抬头</th><th>单间数量</th><th>标准间数量</th><th>到达时间</th><th>离会时间</th><th>需清真食品份数</th><th>学校抽签号</th>
                            </tr>
                            <?PHP echo $string4_2;?>
                        </table>
                    </center>
                </div>
                <div id="volunteer_signup" class="judge-div">
                    <center>
                        <table id="table_8" border="1"  cellspacing="0" style='width: 1600px;'>
                            <tr>
                                <th colspan="9">志愿者注册信息</th>
                            </tr>
                            <tr>
                                <th>Email</th><th>姓名</th><th>性别</th><th>志愿者职务</th><th>工作天数</th><th>手机号码</th><th>衣服尺码</th><th>银行卡号</th><th>是否为管理员</th>
                            </tr>
                            <?PHP echo $string4_3;?>
                        </table>
                    </center>
                </div>
                <center>
                    <button class="btn" type="button" onclick="method5()" style="margin-top: 20px;">导出当前表格到Excel</button>
                </center>
            </div>


        </div>

        <script type='text/javascript'>
            window.onload = function () {
                window_leader(0);
            }
            function div_box_margin_active() {
                document.getElementById("grand").style = "margin-top:110px;";
            }
            function div_box_margin_deactive() {
                document.getElementById("grand").style = "margin-top:0px;";
            }
            window_leader_id_list = ['judge_site', 'judge_score', 'judge_signup', 'school_score', 'participant_score', 'question_select', 'participant_signup', 'school_signup', 'volunteer_signup'];
            var window_index = 0;
            function window_leader(index) {
                window_index = index;
                for (i = 0; i < window_leader_id_list.length; i++) {
                    if (i == index) {
                        document.getElementById(window_leader_id_list[i]).style.visibility = "visible";//显示
                        document.getElementById(window_leader_id_list[i]).style.display = "";//显
                    } else {
                        document.getElementById(window_leader_id_list[i]).style.visibility = "hidden";//隐藏
                        document.getElementById(window_leader_id_list[i]).style.display = "none";//隐藏
                    }
                }
            }

            var idTmr;
            function  getExplorer() {
                var explorer = window.navigator.userAgent;
                //ie  
                if (explorer.indexOf("MSIE") >= 0) {
                    return 'ie';
                }
                //firefox  
                else if (explorer.indexOf("Firefox") >= 0) {
                    return 'Firefox';
                }
                //Chrome  
                else if (explorer.indexOf("Chrome") >= 0) {
                    return 'Chrome';
                }
                //Opera  
                else if (explorer.indexOf("Opera") >= 0) {
                    return 'Opera';
                }
                //Safari  
                else if (explorer.indexOf("Safari") >= 0) {
                    return 'Safari';
                }
            }
            function method5() {
                tableid = 'table_' + window_index;
                if (getExplorer() == 'ie')
                {
                    var curTbl = document.getElementById(tableid);
                    var oXL = new ActiveXObject("Excel.Application");
                    var oWB = oXL.Workbooks.Add();
                    var xlsheet = oWB.Worksheets(1);
                    var sel = document.body.createTextRange();
                    sel.moveToElementText(curTbl);
                    sel.select();
                    sel.execCommand("Copy");
                    xlsheet.Paste();
                    oXL.Visible = true;

                    try {
                        var fname = oXL.Application.GetSaveAsFilename("Excel.xls", "Excel Spreadsheets (*.xls), *.xls");
                    } catch (e) {
                        print("Nested catch caught " + e);
                    } finally {
                        oWB.SaveAs(fname);
                        oWB.Close(savechanges = false);
                        oXL.Quit();
                        oXL = null;
                        idTmr = window.setInterval("Cleanup();", 1);
                    }

                } else
                {
                    tableToExcel(tableid)
                }
            }
            function Cleanup() {
                window.clearInterval(idTmr);
                CollectGarbage();
            }
            var tableToExcel = (function () {
                var uri = 'data:application/vnd.ms-excel;base64,',
                        template = '<html><head><meta charset="UTF-8"></head><body><table>{table}</table></body></html>',
                        base64 = function (s) {
                            return window.btoa(unescape(encodeURIComponent(s)))
                        },
                        format = function (s, c) {
                            return s.replace(/{(\w+)}/g,
                                    function (m, p) {
                                        return c[p];
                                    })
                        }
                return function (table, name) {
                    if (!table.nodeType)
                        table = document.getElementById(table)
                    var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}
                    window.location.href = uri + base64(format(template, ctx))
                }
            })()
        </script>





    </body>
</html>
